home *** CD-ROM | disk | FTP | other *** search
/ Amiga Game-Power / Amiga Game-Power.iso / anwendungen / gw print / structurebrowser_v1.3 / sources / sbimage.c < prev    next >
C/C++ Source or Header  |  1994-05-20  |  2KB  |  61 lines

  1. /*
  2.    Handles the Intuition Image structure
  3. */
  4.  
  5. #include "header/sb.h"
  6.  
  7. extern int level;         /* recursion level */
  8.  
  9.  
  10. /*
  11.   PrImage
  12.  
  13.   Put up the data for an Image structure
  14. */
  15.  
  16. PrImage (string, image)
  17. char *string;
  18. struct Image *image;
  19. {
  20. static struct StructData structdata [] =
  21.   {
  22.      { "-LeftEdge",     "SHORT",               PRINT,      INTSIZE },
  23.      { "-TopEdge",      "SHORT",               PRINT,      INTSIZE },
  24.      { "-Width",        "SHORT",               PRINT,      INTSIZE },
  25.      { "-Height",       "SHORT",               PRINT,      INTSIZE },
  26.      { "-Depth",        "SHORT",               PRINT,      INTSIZE },
  27.      { " ImageData",    "USHORT *",            PRPTR,      PTRSIZE },
  28.      { "-PlanePick",    "UBYTE",               PRUBYTE,    BYTESIZE},
  29.      { "-PlaneOnOff",   "UBYTE",               PRUBYTE,    BYTESIZE},
  30.      { " NextImage",    "struct Image *",      PRPTR,      PTRSIZE }
  31.   };
  32. int i, sum;
  33. int choice = -1;
  34.  
  35.    level++;
  36.  
  37.    while (choice)
  38.    {
  39.       sum = SetOptionText(string, structdata, (APTR)image, DATASIZE, 0);
  40.  
  41.       switch (choice = GetChoice(DATASIZE))
  42.       {
  43.          case 6:
  44.             if (image->ImageData)
  45.                HexDump("Bitmap of Intuition Image",
  46.                      image->ImageData,
  47.                      INTSIZE,
  48.                      (long)((((image->Width + 15) >> 4)
  49.                         * image->Height
  50.                         * image->Depth) << 1)
  51.                      );
  52.             break;
  53.          case 9:
  54.             if (image->NextImage)
  55.                PrImage("The next Image", image->NextImage);
  56.             break;
  57.       }
  58.    }
  59.    level--;
  60. }
  61.